//
//  comnewsTableViewCell.m
//  BAOASystem
//
//  Created by michael on 2018/2/2.
//  Copyright © 2018年 czd. All rights reserved.
//
#import "qiyecaigouViewController.h"
#import "comnewsTableViewCell.h"
#import "qiyexqViewController.h"
@implementation comnewsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;

    _comtitle.text = NSLocalizedString(@"商品详情-公司信息", nil);
        _qiyename.text = NSLocalizedString(@"商品详情-企业名称", nil);
        _qiyenaturetitle.text = NSLocalizedString(@"商品详情-企业性质", nil);
        _Locationtitle.text = NSLocalizedString(@"商品详情-所在地", nil);
   _addresstitle.text = NSLocalizedString(@"商品详情-地址", nil);
   _emailtitle.text = NSLocalizedString(@"商品详情-公司主页", nil);


}
- (void)layoutSubviews{

[super layoutSubviews];
_qiyenamecontent.text = _dict[@"name"];
_qiyenaturecontent.text = _dict[@"type"];
_Locationcontent.text = _dict[@"areaId"];
_addresscontent.text = _dict[@"address"];
_emailcontent.text = _dict[@"websites"];
CGFloat height = [OAToolBox sizebyText:_dict[@"address"] font:13 minsWidth:100];
          CGFloat height2 = [OAToolBox sizebyText:_dict[@"websites"] font:13 minsWidth:100];
if(height>31.5){
_addresstitle.height = 47;
_addresscontent.height = 47;

}
if(height2>31.5){
_emailtitle.height = 47;
_emailcontent.height = 47;
//_addresscontent.height = 47;

}
_qiye.top = _emailtitle.bottom+5;
//CGFloat height = [UILabel getHeightByWidth:KScreenWidth-120 title:_dict[@"address"] font:_addresscontent.font];
//_addresscontent.height = height;
if (![_dict[@"rztype"]isEqual:[NSNull null]]) {
    _qiye.text = _dict[@"rztype"];
// _huiyuan
}else{
//_huiyuanimage
_qiyeimage.hidden = YES;
}
if (![_dict[@"viptype"]isEqual:[NSNull null]]) {
    _huiyuan.text = _dict[@"viptype"];
    
}else{

_huiyuanimage.hidden = YES;
}
[_action setTitle:NSLocalizedString(@"商品详情-详细信息", nil) forState:UIControlStateNormal];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)xiangqingaction:(id)sender {
if ([_type isEqualToString:@"caigou"]) {
    qiyecaigouViewController *vc = [[qiyecaigouViewController alloc]init];
    vc.pdid = _dict[@"id"];
vc.type = _type;
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}else{
qiyexqViewController *vc = [[qiyexqViewController alloc]init];
vc.pdid = _dict[@"id"];
vc.type = _type;
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}

}
@end
